from functools import cached_property

from webutils.layers.managers.redis import LockMixin

from .base import BaseManager


class SessionLock(LockMixin, BaseManager):
    required_context = ['room_id', 'session_id']

    @cached_property
    def lock_key(self):
        return self.get_redis_key('lock', self.room_id, self.session_id)
